<?php
require_once('models/Validator.class.php');

if(!Validator::validateUploadedImage($_FILES['file']['name'], $_FILES['file']['type'], $_FILES['file']['size'])) 
{	 
	 //trigger_error("Not validate uploaded Image", E_USER_WARNING);
	// exit;
	 
	  echo "error-upload:Not validate uploaded Image";
	 
}
else 
{
	 require_once('models/Image.class.php');
	 if (!is_uploaded_file($_FILES['file']['tmp_name'])) 
	{
		 trigger_error("Photo ".$_FILES['file']['name']." hasn't been uploaded", E_USER_WARNING);
		 return;
	}

	$image = new Image();
	$result=$image->move($_FILES);

	if (!$result)
	{
		  trigger_error("Photo ".$_FILES['file']['name']." hasn't been moved", E_USER_WARNING);
	}
	else 
	{
		 echo $result;
	}
	 
}





?>